This repository was archived by the owner on Mar 28, 2020. It is now read-only.
WIP: [Swift+WASM] patches to support compiling Swift to WebAssembly#155
Draft
zhuowei wants to merge 8 commits intoapple:stablefrom
Draft
WIP: [Swift+WASM] patches to support compiling Swift to WebAssembly#155zhuowei wants to merge 8 commits intoapple:stablefrom
zhuowei wants to merge 8 commits intoapple:stablefrom
Conversation
Collaborator
|
These should be sent to llvm.org, not be merged into the swift repos. |
Author
|
@compnerd Thanks! Yes, we're planning to upstream these. |
8361893 to
b8d0917
Compare
…hot/cold split directives
This doesn't fix the alignment issue yet. See https://bugs.llvm.org/show_bug.cgi?id=35928 and https://reviews.llvm.org/D42233.
Like Patcheng's https://reviews.llvm.org/D42233 but for Custom Sections instead padding for the padding gods.
Also try hard to extract a symbol from a MCExpr when writing relocations I doubt this is the right way, but hey it emits an object now
I actually do need to know what's breaking.
Swift uses aliased symbols to refer to offsets within metadata structures.
eg
```
@"$s12SwiftPrivate28_stdlib_ShardedAtomicCounterVN" = alias %swift.type, bitcast (i32* getelementptr inbounds (<{ i8**, i32, <{ i32, i32, i32, i32, i32, i32, i32 }>*, i32, i32 }>, <{ i8**, i32, <{ i32, i32, i32, i32, i32, i32, i32 }>*, i32, i32 }>* @"$s12SwiftPrivate28_stdlib_ShardedAtomicCounterVMf", i32 0, i32 1) to %swift.type*)
```
My previous commit only got the alias to refer to the correct target symbol,
but not at the right offset.
This commit properly emits these symbols.
With this change, print("hello world") works but print() with anything else is still broken.
Don't need the logging anymore This reverts commit 8b8f31f.
b8d0917 to
25e9748
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are the LLVM changes required to cross-compile Swift programs to WebAssembly.
List of changes:
See swiftlang/swift#24684 for more information.
We're planning to upstream the required patches to upstream LLVM.